/**
 * 选择服务人员的模式，2系统自动选，1自己去选
 */
var page = sm("do_Page");
var app = sm("do_App");
var storage = sm("do_Storage");
var nf = sm("do_Notification");
var root = ui("$");
var homemakingUtil = require("url/homemaking");
var qqHttp = require("helper/http");

var aLayout_selectType1 = ui("aLayout_selectType1");
var aLayout_selectType2 = ui("aLayout_selectType2");
var label_selectType1 = ui("label_selectType1");
var label_selectType2 = ui("label_selectType2");
var param= {};

//遮罩显示
var animMaskShow = mm("do_Animator");
var propsMS = {bgColor:"00000077"};
animMaskShow.append(360,propsMS,"EaseOut");
//面板显示
var animPanelShow = mm("do_Animator");
var propsPS = {y:460};
animPanelShow.append(360,propsPS,"EaseOut");
//遮罩隐藏
var animMaskHide = mm("do_Animator");
var propsMH = {bgColor:"00000000"};
animMaskHide.append(360,propsMH,"EaseIn");
//面板隐藏
var animPanelHide = mm("do_Animator");
var propsPH = {y:960};
animPanelHide.append(360,propsPH,"EaseIn");

//picker
var labtit = ui("labtit");
var pickerbg = ui("pickerbg");//遮罩
var pickerbox = ui("do_ALayout_1");

page.on("showMemberType",function(data){
	pickerbg.visible = true;
	pickerbg.animate(animMaskShow);
	pickerbox.animate(animPanelShow);
});

//遮罩事件
pickerbg.on("touch","",300,function(){
	hidePane();
});

//防穿透
pickerbox.on("touch",function(){})

aLayout_selectType2.on("touch", function(data) {
	//系统帮选
	hidePane();
	page.fire("refreshSelectMemberType",{type:2});
});

aLayout_selectType1.on("touch", function(data) {
	//自己去选
	hidePane();
	page.fire("refreshSelectMemberType",{type:1});
});

function hidePane() {
	pickerbox.animate(animPanelHide);
	pickerbg.animate(animMaskHide,function(){
		pickerbg.visible = false;
	});
}
